<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>公共课管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {

	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/dd/ddCommonCourse/">公共课列表</a></li>
		<shiro:hasPermission name="dd:ddCommonCourse:edit">
			<li><a href="${ctx}/dd/ddCommonCourse/form">添加</a></li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="ddCommonCourse"
		action="${ctx}/dd/ddCommonCourse/" method="post"
		class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />
		<ul class="ul-form">
		<li><label>教师：</label>
			<form:input path="teacherName" htmlEscape="false" maxlength="50" class="input-medium"/>
		</li>
		<li><label>课程名：</label>
			<form:input path="course" htmlEscape="false" maxlength="50" class="input-medium"/>
		</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary"
				type="submit" value="查询" /></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}" />
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>课程</th>
				<th>学校</th>
				<th>教师</th>
				<th>教室</th>
				<th>班级</th>
				<th>时间段</th>
				<shiro:hasPermission name="dd:ddCommonCourse:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="ddCommonCourse">
				<tr>
				<td><a href="${ctx}/dd/ddCommonCourse/form?id=${ddCommonCourse.id}">${ddCommonCourse.course}</a></td>
				<td>${fns:getSchoolName(ddCommonCourse.schoolId)}</td>
				<td>${fns:getTeacherName(ddCommonCourse.teacherId)}</td>
				<td>${fns:getClassRoomName(ddCommonCourse.classroomId)}</td>
				<td>${fns:getClassesNameByIds(ddCommonCourse.classesIds)}</td>
				<td>${fns:getDictLabels(ddCommonCourse.weeks, "weeks", "")}&nbsp;&nbsp;
					<fmt:formatDate value="${ddCommonCourse.startTime}" pattern="HH:mm:ss" />~
					<fmt:formatDate value="${ddCommonCourse.endTime}" pattern="HH:mm:ss" />
				</td>
					<shiro:hasPermission name="dd:ddCommonCourse:edit">
						<td><a
							href="${ctx}/dd/ddCommonCourse/form?id=${ddCommonCourse.id}">修改</a>
							<a href="${ctx}/dd/ddCommonCourse/delete?id=${ddCommonCourse.id}"
							onclick="return confirmx('确认要删除该单表吗？', this.href)">删除</a></td>
					</shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>